package com.gwnet.shop.service.impl;

import java.util.List;
import com.gwnet.common.core.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.gwnet.shop.mapper.ShopTypeMapper;
import com.gwnet.shop.domain.ShopType;
import com.gwnet.shop.service.IShopTypeService;
import javax.annotation.Resource;

/**
 * 商城类型Service业务层处理
 * @author 张万鹏
 * @date 2024-07-30
 */
@Service
public class ShopTypeServiceImpl implements IShopTypeService 
{
    @Resource
    private ShopTypeMapper shopTypeMapper;

    /**
     * 查询商城类型
     * @param id 商城类型主键
     * @return 商城类型
     */
    @Override
    public ShopType selectShopTypeById(Long id)
    {
        return shopTypeMapper.selectShopTypeById(id);
    }

    /**
     * 查询商城类型列表
     * 
     * @param shopType 商城类型
     * @return 商城类型
     */
    @Override
    public List<ShopType> selectShopTypeList(ShopType shopType)
    {
        return shopTypeMapper.selectShopTypeList(shopType);
    }

    /**
     * 新增商城类型
     * 
     * @param shopType 商城类型
     * @return 结果
     */
    @Override
    public int insertShopType(ShopType shopType)
    {
        shopType.setCreateTime(DateUtils.getNowDate());
        return shopTypeMapper.insertShopType(shopType);
    }

    /**
     * 修改商城类型
     * 
     * @param shopType 商城类型
     * @return 结果
     */
    @Override
    public int updateShopType(ShopType shopType)
    {
        shopType.setUpdateTime(DateUtils.getNowDate());
        return shopTypeMapper.updateShopType(shopType);
    }

    /**
     * 批量删除商城类型
     * 
     * @param ids 需要删除的商城类型主键
     * @return 结果
     */
    @Override
    public int deleteShopTypeByIds(Long[] ids)
    {
        return shopTypeMapper.deleteShopTypeByIds(ids);
    }

    /**
     * 删除商城类型信息
     * 
     * @param id 商城类型主键
     * @return 结果
     */
    @Override
    public int deleteShopTypeById(Long id)
    {
        return shopTypeMapper.deleteShopTypeById(id);
    }
}
